import React from 'react'
import store from '../../store/store'
import { getMovieAction } from '../../store/actions/movieAction'
export default function Movie() {
  const { count } = store.getState().count
  //获取电影列表
  const { movieList } = store.getState().movie
  console.log(movieList,'movieList');
  // const list = movieList.data.data.list
  // console.log(list,'list');
  //点击事件获取电影列表
  const getmovieList = () => {
    store.dispatch(getMovieAction())
  }
  return (
    <div>
      <h1>我是Movie组件</h1>
      <p>我收到的Count组件的值是 {count}</p>
      <button onClick={getmovieList}>获取电影列表</button>
      {
        movieList.map(item => {
          return <li key={item.albumId}>{item.albumName}</li>
        })
      }
    </div>
  )
}
